<p>当调用<code> BufferedReader.readLine()</code >，<code> Reader.read()</code>以及任何子类中的这些方法时，如果代码忽略了返回值或仅仅对返回值进行了是否为null的判断时，我们认为这个代码是有问题的。</p>

<h2>不规范的代码示例</h2>
<pre>
public void doSomethingWithFile(String fileName) {
  BufferedReader buffReader = null;
  try {
    buffReader = new BufferedReader(new FileReader(fileName));
    while (buffReader.readLine() != null) { // Noncompliant
      // ...
    }
  } catch (IOException e) {
    // ...
  }
} 
</pre>

<h2>正确的代码示例</h2>
<pre>
public void doSomethingWithFile(String fileName) {
  BufferedReader buffReader = null;
  try {
    buffReader = new BufferedReader(new FileReader(fileName));
    String line = null;
    while ((line = buffReader.readLine()) != null) {
      // ...
    }
  } catch (IOException e) {
    // ...
  }
}
</pre>

